{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total words: 888723\n",
      "Vocabulary size: 9251\n",
      "Word preprocessing completed ...\n",
      "WARNING:tensorflow:From /usr/local/lib/python3.6/site-packages/tensorflow/python/ops/nn_impl.py:1346: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "\n",
      "Future major versions of TensorFlow will allow gradients to flow\n",
      "into the labels input on backprop by default.\n",
      "\n",
      "See tf.nn.softmax_cross_entropy_with_logits_v2.\n",
      "\n",
      "Data Shuffled\n",
      "Epoch 1/10 | Batch 0/1545 | train loss: 3.6946\n",
      "Nearest to [six]: enact, runkel, meantime, inch, was,\n",
      "Nearest to [gold]: depress, genentech, unfortunate, pledge, arguing,\n",
      "Nearest to [japan]: bernard, spouse, mailing, halt, sang,\n",
      "Nearest to [college]: discounting, complete, private, freddie, defendant,\n",
      "Epoch 1/10 | Batch 50/1545 | train loss: 3.5260\n",
      "Epoch 1/10 | Batch 100/1545 | train loss: 3.2283\n",
      "Epoch 1/10 | Batch 150/1545 | train loss: 3.6859\n",
      "Epoch 1/10 | Batch 200/1545 | train loss: 3.5730\n",
      "Epoch 1/10 | Batch 250/1545 | train loss: 3.3671\n",
      "Epoch 1/10 | Batch 300/1545 | train loss: 3.8272\n",
      "Epoch 1/10 | Batch 350/1545 | train loss: 3.5215\n",
      "Epoch 1/10 | Batch 400/1545 | train loss: 3.8107\n",
      "Epoch 1/10 | Batch 450/1545 | train loss: 3.5948\n",
      "Epoch 1/10 | Batch 500/1545 | train loss: 3.8243\n",
      "Epoch 1/10 | Batch 550/1545 | train loss: 3.1904\n",
      "Epoch 1/10 | Batch 600/1545 | train loss: 3.4282\n",
      "Epoch 1/10 | Batch 650/1545 | train loss: 3.1884\n",
      "Epoch 1/10 | Batch 700/1545 | train loss: 3.8623\n",
      "Epoch 1/10 | Batch 750/1545 | train loss: 3.4765\n",
      "Epoch 1/10 | Batch 800/1545 | train loss: 3.0110\n",
      "Epoch 1/10 | Batch 850/1545 | train loss: 3.2705\n",
      "Epoch 1/10 | Batch 900/1545 | train loss: 3.4115\n",
      "Epoch 1/10 | Batch 950/1545 | train loss: 3.0006\n",
      "Epoch 1/10 | Batch 1000/1545 | train loss: 2.6920\n",
      "Nearest to [six]: was, carnival, problem, troop, bank,\n",
      "Nearest to [gold]: ounce, moderate, silver, december, ounces,\n",
      "Nearest to [japan]: uncovered, emissions, workout, accompanied, greenspan,\n",
      "Nearest to [college]: having, let, never, ask, man,\n",
      "Epoch 1/10 | Batch 1050/1545 | train loss: 3.7049\n",
      "Epoch 1/10 | Batch 1100/1545 | train loss: 3.4003\n",
      "Epoch 1/10 | Batch 1150/1545 | train loss: 4.2520\n",
      "Epoch 1/10 | Batch 1200/1545 | train loss: 2.9778\n",
      "Epoch 1/10 | Batch 1250/1545 | train loss: 3.2441\n",
      "Epoch 1/10 | Batch 1300/1545 | train loss: 2.9554\n",
      "Epoch 1/10 | Batch 1350/1545 | train loss: 3.0307\n",
      "Epoch 1/10 | Batch 1400/1545 | train loss: 2.9421\n",
      "Epoch 1/10 | Batch 1450/1545 | train loss: 3.1836\n",
      "Epoch 1/10 | Batch 1500/1545 | train loss: 2.6754\n",
      "Data Shuffled\n",
      "Epoch 2/10 | Batch 0/1545 | train loss: 3.2930\n",
      "Nearest to [six]: was, carnival, ships, donuts, attempts,\n",
      "Nearest to [gold]: ounce, moderate, silver, commodity, platinum,\n",
      "Nearest to [japan]: revamping, flexibility, greenspan, halt, urban,\n",
      "Nearest to [college]: basketball, contemporary, mcduffie, things, characters,\n",
      "Epoch 2/10 | Batch 50/1545 | train loss: 3.6149\n",
      "Epoch 2/10 | Batch 100/1545 | train loss: 3.2603\n",
      "Epoch 2/10 | Batch 150/1545 | train loss: 2.7252\n",
      "Epoch 2/10 | Batch 200/1545 | train loss: 3.2109\n",
      "Epoch 2/10 | Batch 250/1545 | train loss: 3.8905\n",
      "Epoch 2/10 | Batch 300/1545 | train loss: 3.4359\n",
      "Epoch 2/10 | Batch 350/1545 | train loss: 2.9856\n",
      "Epoch 2/10 | Batch 400/1545 | train loss: 3.7584\n",
      "Epoch 2/10 | Batch 450/1545 | train loss: 2.8445\n",
      "Epoch 2/10 | Batch 500/1545 | train loss: 2.7886\n",
      "Epoch 2/10 | Batch 550/1545 | train loss: 2.7081\n",
      "Epoch 2/10 | Batch 600/1545 | train loss: 3.9816\n",
      "Epoch 2/10 | Batch 650/1545 | train loss: 3.2674\n",
      "Epoch 2/10 | Batch 700/1545 | train loss: 3.7068\n",
      "Epoch 2/10 | Batch 750/1545 | train loss: 2.9442\n",
      "Epoch 2/10 | Batch 800/1545 | train loss: 2.8798\n",
      "Epoch 2/10 | Batch 850/1545 | train loss: 2.9409\n",
      "Epoch 2/10 | Batch 900/1545 | train loss: 3.0363\n",
      "Epoch 2/10 | Batch 950/1545 | train loss: 3.4921\n",
      "Epoch 2/10 | Batch 1000/1545 | train loss: 3.0225\n",
      "Nearest to [six]: ships, was, carnival, finland, emerge,\n",
      "Nearest to [gold]: ounce, ounces, silver, platinum, commodity,\n",
      "Nearest to [japan]: halt, revamping, greenspan, flexibility, exchanges,\n",
      "Nearest to [college]: kids, basketball, parents, child, children,\n",
      "Epoch 2/10 | Batch 1050/1545 | train loss: 3.3520\n",
      "Epoch 2/10 | Batch 1100/1545 | train loss: 3.1030\n",
      "Epoch 2/10 | Batch 1150/1545 | train loss: 2.6124\n",
      "Epoch 2/10 | Batch 1200/1545 | train loss: 3.1420\n",
      "Epoch 2/10 | Batch 1250/1545 | train loss: 3.6545\n",
      "Epoch 2/10 | Batch 1300/1545 | train loss: 2.8047\n",
      "Epoch 2/10 | Batch 1350/1545 | train loss: 2.6423\n",
      "Epoch 2/10 | Batch 1400/1545 | train loss: 2.9904\n",
      "Epoch 2/10 | Batch 1450/1545 | train loss: 3.3502\n",
      "Epoch 2/10 | Batch 1500/1545 | train loss: 3.0796\n",
      "Data Shuffled\n",
      "Epoch 3/10 | Batch 0/1545 | train loss: 2.6935\n",
      "Nearest to [six]: ships, emerge, was, carnival, finland,\n",
      "Nearest to [gold]: ounce, ounces, silver, platinum, commodity,\n",
      "Nearest to [japan]: halt, greenspan, thereby, revamping, flexibility,\n",
      "Nearest to [college]: basketball, football, kids, audiences, children,\n",
      "Epoch 3/10 | Batch 50/1545 | train loss: 2.9403\n",
      "Epoch 3/10 | Batch 100/1545 | train loss: 2.6900\n",
      "Epoch 3/10 | Batch 150/1545 | train loss: 3.1415\n",
      "Epoch 3/10 | Batch 200/1545 | train loss: 2.7785\n",
      "Epoch 3/10 | Batch 250/1545 | train loss: 3.2002\n",
      "Epoch 3/10 | Batch 300/1545 | train loss: 2.5229\n",
      "Epoch 3/10 | Batch 350/1545 | train loss: 2.8759\n",
      "Epoch 3/10 | Batch 400/1545 | train loss: 2.5635\n",
      "Epoch 3/10 | Batch 450/1545 | train loss: 2.8483\n",
      "Epoch 3/10 | Batch 500/1545 | train loss: 2.9317\n",
      "Epoch 3/10 | Batch 550/1545 | train loss: 2.4299\n",
      "Epoch 3/10 | Batch 600/1545 | train loss: 3.0184\n",
      "Epoch 3/10 | Batch 650/1545 | train loss: 2.8305\n",
      "Epoch 3/10 | Batch 700/1545 | train loss: 2.7454\n",
      "Epoch 3/10 | Batch 750/1545 | train loss: 3.0075\n",
      "Epoch 3/10 | Batch 800/1545 | train loss: 2.7318\n",
      "Epoch 3/10 | Batch 850/1545 | train loss: 2.6585\n",
      "Epoch 3/10 | Batch 900/1545 | train loss: 2.5398\n",
      "Epoch 3/10 | Batch 950/1545 | train loss: 2.8238\n",
      "Epoch 3/10 | Batch 1000/1545 | train loss: 2.9874\n",
      "Nearest to [six]: ships, schedule, cruise, emerge, was,\n",
      "Nearest to [gold]: ounce, ounces, platinum, bullion, silver,\n",
      "Nearest to [japan]: thereby, halt, flexibility, greenspan, revamping,\n",
      "Nearest to [college]: basketball, sports, football, audiences, colleges,\n",
      "Epoch 3/10 | Batch 1050/1545 | train loss: 2.8645\n",
      "Epoch 3/10 | Batch 1100/1545 | train loss: 2.8435\n",
      "Epoch 3/10 | Batch 1150/1545 | train loss: 2.8114\n",
      "Epoch 3/10 | Batch 1200/1545 | train loss: 3.1793\n",
      "Epoch 3/10 | Batch 1250/1545 | train loss: 2.7298\n",
      "Epoch 3/10 | Batch 1300/1545 | train loss: 3.3626\n",
      "Epoch 3/10 | Batch 1350/1545 | train loss: 2.9679\n",
      "Epoch 3/10 | Batch 1400/1545 | train loss: 2.8729\n",
      "Epoch 3/10 | Batch 1450/1545 | train loss: 2.7758\n",
      "Epoch 3/10 | Batch 1500/1545 | train loss: 2.4018\n",
      "Data Shuffled\n",
      "Epoch 4/10 | Batch 0/1545 | train loss: 2.9856\n",
      "Nearest to [six]: schedule, emerge, ships, finland, merged,\n",
      "Nearest to [gold]: ounce, bullion, ounces, platinum, silver,\n",
      "Nearest to [japan]: halt, exchanges, flexibility, thereby, greenspan,\n",
      "Nearest to [college]: basketball, sports, parents, football, child,\n",
      "Epoch 4/10 | Batch 50/1545 | train loss: 2.4984\n",
      "Epoch 4/10 | Batch 100/1545 | train loss: 2.5274\n",
      "Epoch 4/10 | Batch 150/1545 | train loss: 2.6891\n",
      "Epoch 4/10 | Batch 200/1545 | train loss: 2.9773\n",
      "Epoch 4/10 | Batch 250/1545 | train loss: 2.8103\n",
      "Epoch 4/10 | Batch 300/1545 | train loss: 2.9578\n",
      "Epoch 4/10 | Batch 350/1545 | train loss: 2.8713\n",
      "Epoch 4/10 | Batch 400/1545 | train loss: 2.4680\n",
      "Epoch 4/10 | Batch 450/1545 | train loss: 2.7729\n",
      "Epoch 4/10 | Batch 500/1545 | train loss: 2.7352\n",
      "Epoch 4/10 | Batch 550/1545 | train loss: 2.6108\n",
      "Epoch 4/10 | Batch 600/1545 | train loss: 2.4470\n",
      "Epoch 4/10 | Batch 650/1545 | train loss: 2.9130\n",
      "Epoch 4/10 | Batch 700/1545 | train loss: 2.3081\n",
      "Epoch 4/10 | Batch 750/1545 | train loss: 2.4282\n",
      "Epoch 4/10 | Batch 800/1545 | train loss: 3.4740\n",
      "Epoch 4/10 | Batch 850/1545 | train loss: 2.8102\n",
      "Epoch 4/10 | Batch 900/1545 | train loss: 2.4646\n",
      "Epoch 4/10 | Batch 950/1545 | train loss: 2.4189\n",
      "Epoch 4/10 | Batch 1000/1545 | train loss: 2.6538\n",
      "Nearest to [six]: schedule, emerge, merged, finland, ships,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, silver,\n",
      "Nearest to [japan]: halt, flexibility, revamping, exchanges, deeper,\n",
      "Nearest to [college]: basketball, sports, football, child, junior,\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 4/10 | Batch 1050/1545 | train loss: 2.4011\n",
      "Epoch 4/10 | Batch 1100/1545 | train loss: 2.8131\n",
      "Epoch 4/10 | Batch 1150/1545 | train loss: 2.4436\n",
      "Epoch 4/10 | Batch 1200/1545 | train loss: 2.5672\n",
      "Epoch 4/10 | Batch 1250/1545 | train loss: 2.4642\n",
      "Epoch 4/10 | Batch 1300/1545 | train loss: 2.8515\n",
      "Epoch 4/10 | Batch 1350/1545 | train loss: 2.3709\n",
      "Epoch 4/10 | Batch 1400/1545 | train loss: 2.9212\n",
      "Epoch 4/10 | Batch 1450/1545 | train loss: 2.5565\n",
      "Epoch 4/10 | Batch 1500/1545 | train loss: 2.5253\n",
      "Data Shuffled\n",
      "Epoch 5/10 | Batch 0/1545 | train loss: 2.1449\n",
      "Nearest to [six]: schedule, emerge, finland, ships, merged,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, silver,\n",
      "Nearest to [japan]: halt, exchanges, eliminating, greenspan, revamping,\n",
      "Nearest to [college]: basketball, football, sports, junior, child,\n",
      "Epoch 5/10 | Batch 50/1545 | train loss: 2.2285\n",
      "Epoch 5/10 | Batch 100/1545 | train loss: 2.4473\n",
      "Epoch 5/10 | Batch 150/1545 | train loss: 2.1491\n",
      "Epoch 5/10 | Batch 200/1545 | train loss: 3.0299\n",
      "Epoch 5/10 | Batch 250/1545 | train loss: 2.4413\n",
      "Epoch 5/10 | Batch 300/1545 | train loss: 2.9099\n",
      "Epoch 5/10 | Batch 350/1545 | train loss: 2.5728\n",
      "Epoch 5/10 | Batch 400/1545 | train loss: 2.7002\n",
      "Epoch 5/10 | Batch 450/1545 | train loss: 2.1950\n",
      "Epoch 5/10 | Batch 500/1545 | train loss: 1.9489\n",
      "Epoch 5/10 | Batch 550/1545 | train loss: 2.7987\n",
      "Epoch 5/10 | Batch 600/1545 | train loss: 2.4115\n",
      "Epoch 5/10 | Batch 650/1545 | train loss: 2.6092\n",
      "Epoch 5/10 | Batch 700/1545 | train loss: 3.2602\n",
      "Epoch 5/10 | Batch 750/1545 | train loss: 2.1957\n",
      "Epoch 5/10 | Batch 800/1545 | train loss: 2.6259\n",
      "Epoch 5/10 | Batch 850/1545 | train loss: 2.3155\n",
      "Epoch 5/10 | Batch 900/1545 | train loss: 2.5721\n",
      "Epoch 5/10 | Batch 950/1545 | train loss: 2.3832\n",
      "Epoch 5/10 | Batch 1000/1545 | train loss: 2.4177\n",
      "Nearest to [six]: schedule, finland, ships, emerge, merged,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, silver,\n",
      "Nearest to [japan]: halt, eliminating, exchanges, greenspan, goals,\n",
      "Nearest to [college]: basketball, sports, football, child, colleges,\n",
      "Epoch 5/10 | Batch 1050/1545 | train loss: 2.4060\n",
      "Epoch 5/10 | Batch 1100/1545 | train loss: 2.8070\n",
      "Epoch 5/10 | Batch 1150/1545 | train loss: 2.4239\n",
      "Epoch 5/10 | Batch 1200/1545 | train loss: 2.7967\n",
      "Epoch 5/10 | Batch 1250/1545 | train loss: 2.2725\n",
      "Epoch 5/10 | Batch 1300/1545 | train loss: 2.4924\n",
      "Epoch 5/10 | Batch 1350/1545 | train loss: 2.2478\n",
      "Epoch 5/10 | Batch 1400/1545 | train loss: 2.4505\n",
      "Epoch 5/10 | Batch 1450/1545 | train loss: 2.8086\n",
      "Epoch 5/10 | Batch 1500/1545 | train loss: 2.2495\n",
      "Data Shuffled\n",
      "Epoch 6/10 | Batch 0/1545 | train loss: 2.2936\n",
      "Nearest to [six]: schedule, finland, reductions, ships, emerge,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: halt, eliminating, exchanges, greenspan, threaten,\n",
      "Nearest to [college]: basketball, sports, football, child, colleges,\n",
      "Epoch 6/10 | Batch 50/1545 | train loss: 2.4435\n",
      "Epoch 6/10 | Batch 100/1545 | train loss: 2.0927\n",
      "Epoch 6/10 | Batch 150/1545 | train loss: 2.1125\n",
      "Epoch 6/10 | Batch 200/1545 | train loss: 2.5687\n",
      "Epoch 6/10 | Batch 250/1545 | train loss: 2.2082\n",
      "Epoch 6/10 | Batch 300/1545 | train loss: 2.2503\n",
      "Epoch 6/10 | Batch 350/1545 | train loss: 2.4939\n",
      "Epoch 6/10 | Batch 400/1545 | train loss: 2.5367\n",
      "Epoch 6/10 | Batch 450/1545 | train loss: 2.4174\n",
      "Epoch 6/10 | Batch 500/1545 | train loss: 2.0639\n",
      "Epoch 6/10 | Batch 550/1545 | train loss: 2.3262\n",
      "Epoch 6/10 | Batch 600/1545 | train loss: 2.5880\n",
      "Epoch 6/10 | Batch 650/1545 | train loss: 2.5594\n",
      "Epoch 6/10 | Batch 700/1545 | train loss: 2.3678\n",
      "Epoch 6/10 | Batch 750/1545 | train loss: 2.7223\n",
      "Epoch 6/10 | Batch 800/1545 | train loss: 2.5219\n",
      "Epoch 6/10 | Batch 850/1545 | train loss: 2.0206\n",
      "Epoch 6/10 | Batch 900/1545 | train loss: 2.1779\n",
      "Epoch 6/10 | Batch 950/1545 | train loss: 2.7602\n",
      "Epoch 6/10 | Batch 1000/1545 | train loss: 2.5211\n",
      "Nearest to [six]: schedule, finland, ships, syrian, reductions,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: exchanges, halt, eliminating, airline, threaten,\n",
      "Nearest to [college]: basketball, football, sports, child, junior,\n",
      "Epoch 6/10 | Batch 1050/1545 | train loss: 2.7280\n",
      "Epoch 6/10 | Batch 1100/1545 | train loss: 2.4369\n",
      "Epoch 6/10 | Batch 1150/1545 | train loss: 2.4766\n",
      "Epoch 6/10 | Batch 1200/1545 | train loss: 2.3969\n",
      "Epoch 6/10 | Batch 1250/1545 | train loss: 2.5462\n",
      "Epoch 6/10 | Batch 1300/1545 | train loss: 2.2410\n",
      "Epoch 6/10 | Batch 1350/1545 | train loss: 2.7836\n",
      "Epoch 6/10 | Batch 1400/1545 | train loss: 2.0471\n",
      "Epoch 6/10 | Batch 1450/1545 | train loss: 2.2169\n",
      "Epoch 6/10 | Batch 1500/1545 | train loss: 2.4868\n",
      "Data Shuffled\n",
      "Epoch 7/10 | Batch 0/1545 | train loss: 2.5375\n",
      "Nearest to [six]: schedule, finland, emerge, ships, telecommunications,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: halt, exchanges, eliminating, airline, threaten,\n",
      "Nearest to [college]: basketball, colleges, sports, child, junior,\n",
      "Epoch 7/10 | Batch 50/1545 | train loss: 1.8573\n",
      "Epoch 7/10 | Batch 100/1545 | train loss: 2.1436\n",
      "Epoch 7/10 | Batch 150/1545 | train loss: 1.9343\n",
      "Epoch 7/10 | Batch 200/1545 | train loss: 2.6029\n",
      "Epoch 7/10 | Batch 250/1545 | train loss: 2.1402\n",
      "Epoch 7/10 | Batch 300/1545 | train loss: 2.1096\n",
      "Epoch 7/10 | Batch 350/1545 | train loss: 1.8099\n",
      "Epoch 7/10 | Batch 400/1545 | train loss: 2.1330\n",
      "Epoch 7/10 | Batch 450/1545 | train loss: 2.1695\n",
      "Epoch 7/10 | Batch 500/1545 | train loss: 2.2094\n",
      "Epoch 7/10 | Batch 550/1545 | train loss: 2.2918\n",
      "Epoch 7/10 | Batch 600/1545 | train loss: 2.1321\n",
      "Epoch 7/10 | Batch 650/1545 | train loss: 2.6041\n",
      "Epoch 7/10 | Batch 700/1545 | train loss: 2.2591\n",
      "Epoch 7/10 | Batch 750/1545 | train loss: 2.1187\n",
      "Epoch 7/10 | Batch 800/1545 | train loss: 2.1170\n",
      "Epoch 7/10 | Batch 850/1545 | train loss: 2.7587\n",
      "Epoch 7/10 | Batch 900/1545 | train loss: 1.7749\n",
      "Epoch 7/10 | Batch 950/1545 | train loss: 2.3756\n",
      "Epoch 7/10 | Batch 1000/1545 | train loss: 2.2482\n",
      "Nearest to [six]: schedule, emerge, norway, ships, formed,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: halt, eliminating, exchanges, airline, ensure,\n",
      "Nearest to [college]: basketball, child, sports, colleges, football,\n",
      "Epoch 7/10 | Batch 1050/1545 | train loss: 2.0379\n",
      "Epoch 7/10 | Batch 1100/1545 | train loss: 1.9316\n",
      "Epoch 7/10 | Batch 1150/1545 | train loss: 2.4284\n",
      "Epoch 7/10 | Batch 1200/1545 | train loss: 2.3415\n",
      "Epoch 7/10 | Batch 1250/1545 | train loss: 2.3106\n",
      "Epoch 7/10 | Batch 1300/1545 | train loss: 2.2095\n",
      "Epoch 7/10 | Batch 1350/1545 | train loss: 1.7201\n",
      "Epoch 7/10 | Batch 1400/1545 | train loss: 2.3152\n",
      "Epoch 7/10 | Batch 1450/1545 | train loss: 2.6983\n",
      "Epoch 7/10 | Batch 1500/1545 | train loss: 2.2766\n",
      "Data Shuffled\n",
      "Epoch 8/10 | Batch 0/1545 | train loss: 2.0760\n",
      "Nearest to [six]: schedule, merit, ships, finland, norway,\n",
      "Nearest to [gold]: bullion, ounce, platinum, ounces, settled,\n",
      "Nearest to [japan]: eliminating, halt, exchanges, airline, wealth,\n",
      "Nearest to [college]: basketball, child, sports, football, baseball,\n",
      "Epoch 8/10 | Batch 50/1545 | train loss: 1.9937\n",
      "Epoch 8/10 | Batch 100/1545 | train loss: 2.0407\n",
      "Epoch 8/10 | Batch 150/1545 | train loss: 2.4335\n",
      "Epoch 8/10 | Batch 200/1545 | train loss: 2.2460\n",
      "Epoch 8/10 | Batch 250/1545 | train loss: 1.6679\n",
      "Epoch 8/10 | Batch 300/1545 | train loss: 1.8489\n",
      "Epoch 8/10 | Batch 350/1545 | train loss: 1.9547\n",
      "Epoch 8/10 | Batch 400/1545 | train loss: 2.1368\n",
      "Epoch 8/10 | Batch 450/1545 | train loss: 2.1914\n",
      "Epoch 8/10 | Batch 500/1545 | train loss: 2.2588\n",
      "Epoch 8/10 | Batch 550/1545 | train loss: 1.8853\n",
      "Epoch 8/10 | Batch 600/1545 | train loss: 2.1451\n",
      "Epoch 8/10 | Batch 650/1545 | train loss: 2.0305\n",
      "Epoch 8/10 | Batch 700/1545 | train loss: 2.1647\n",
      "Epoch 8/10 | Batch 750/1545 | train loss: 1.9090\n",
      "Epoch 8/10 | Batch 800/1545 | train loss: 1.6457\n",
      "Epoch 8/10 | Batch 850/1545 | train loss: 1.9362\n",
      "Epoch 8/10 | Batch 900/1545 | train loss: 2.1686\n",
      "Epoch 8/10 | Batch 950/1545 | train loss: 2.2075\n",
      "Epoch 8/10 | Batch 1000/1545 | train loss: 2.0204\n",
      "Nearest to [six]: schedule, formed, norway, merit, finland,\n",
      "Nearest to [gold]: bullion, ounce, platinum, ounces, settled,\n",
      "Nearest to [japan]: eliminating, halt, exchanges, wealth, ensure,\n",
      "Nearest to [college]: basketball, child, sports, kids, baseball,\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 8/10 | Batch 1050/1545 | train loss: 2.2328\n",
      "Epoch 8/10 | Batch 1100/1545 | train loss: 2.0191\n",
      "Epoch 8/10 | Batch 1150/1545 | train loss: 2.3768\n",
      "Epoch 8/10 | Batch 1200/1545 | train loss: 2.4429\n",
      "Epoch 8/10 | Batch 1250/1545 | train loss: 2.5401\n",
      "Epoch 8/10 | Batch 1300/1545 | train loss: 2.0623\n",
      "Epoch 8/10 | Batch 1350/1545 | train loss: 2.8382\n",
      "Epoch 8/10 | Batch 1400/1545 | train loss: 2.0885\n",
      "Epoch 8/10 | Batch 1450/1545 | train loss: 2.3987\n",
      "Epoch 8/10 | Batch 1500/1545 | train loss: 1.7573\n",
      "Data Shuffled\n",
      "Epoch 9/10 | Batch 0/1545 | train loss: 2.3791\n",
      "Nearest to [six]: schedule, merit, norway, formed, emerge,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: eliminating, halt, exchanges, wealth, threaten,\n",
      "Nearest to [college]: basketball, child, football, sports, baseball,\n",
      "Epoch 9/10 | Batch 50/1545 | train loss: 1.6602\n",
      "Epoch 9/10 | Batch 100/1545 | train loss: 1.9864\n",
      "Epoch 9/10 | Batch 150/1545 | train loss: 2.4041\n",
      "Epoch 9/10 | Batch 200/1545 | train loss: 2.2251\n",
      "Epoch 9/10 | Batch 250/1545 | train loss: 2.2228\n",
      "Epoch 9/10 | Batch 300/1545 | train loss: 1.8995\n",
      "Epoch 9/10 | Batch 350/1545 | train loss: 1.9895\n",
      "Epoch 9/10 | Batch 400/1545 | train loss: 1.9987\n",
      "Epoch 9/10 | Batch 450/1545 | train loss: 2.3209\n",
      "Epoch 9/10 | Batch 500/1545 | train loss: 2.3518\n",
      "Epoch 9/10 | Batch 550/1545 | train loss: 2.0820\n",
      "Epoch 9/10 | Batch 600/1545 | train loss: 1.8823\n",
      "Epoch 9/10 | Batch 650/1545 | train loss: 1.6524\n",
      "Epoch 9/10 | Batch 700/1545 | train loss: 1.8565\n",
      "Epoch 9/10 | Batch 750/1545 | train loss: 1.9882\n",
      "Epoch 9/10 | Batch 800/1545 | train loss: 2.0219\n",
      "Epoch 9/10 | Batch 850/1545 | train loss: 1.9979\n",
      "Epoch 9/10 | Batch 900/1545 | train loss: 1.9289\n",
      "Epoch 9/10 | Batch 950/1545 | train loss: 1.7694\n",
      "Epoch 9/10 | Batch 1000/1545 | train loss: 1.6573\n",
      "Nearest to [six]: schedule, norway, merit, troop, finland,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: eliminating, wealth, threaten, halt, revamping,\n",
      "Nearest to [college]: basketball, child, athletes, sports, baseball,\n",
      "Epoch 9/10 | Batch 1050/1545 | train loss: 1.5211\n",
      "Epoch 9/10 | Batch 1100/1545 | train loss: 2.2194\n",
      "Epoch 9/10 | Batch 1150/1545 | train loss: 2.4595\n",
      "Epoch 9/10 | Batch 1200/1545 | train loss: 1.9064\n",
      "Epoch 9/10 | Batch 1250/1545 | train loss: 2.1198\n",
      "Epoch 9/10 | Batch 1300/1545 | train loss: 2.2490\n",
      "Epoch 9/10 | Batch 1350/1545 | train loss: 2.1985\n",
      "Epoch 9/10 | Batch 1400/1545 | train loss: 1.7738\n",
      "Epoch 9/10 | Batch 1450/1545 | train loss: 2.0537\n",
      "Epoch 9/10 | Batch 1500/1545 | train loss: 2.2647\n",
      "Data Shuffled\n",
      "Epoch 10/10 | Batch 0/1545 | train loss: 1.8322\n",
      "Nearest to [six]: schedule, formed, merit, norway, industrialized,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: eliminating, exchanges, wealth, halt, airline,\n",
      "Nearest to [college]: basketball, child, sports, baseball, football,\n",
      "Epoch 10/10 | Batch 50/1545 | train loss: 1.8641\n",
      "Epoch 10/10 | Batch 100/1545 | train loss: 1.8244\n",
      "Epoch 10/10 | Batch 150/1545 | train loss: 2.2723\n",
      "Epoch 10/10 | Batch 200/1545 | train loss: 1.6219\n",
      "Epoch 10/10 | Batch 250/1545 | train loss: 2.1264\n",
      "Epoch 10/10 | Batch 300/1545 | train loss: 1.8406\n",
      "Epoch 10/10 | Batch 350/1545 | train loss: 2.3835\n",
      "Epoch 10/10 | Batch 400/1545 | train loss: 2.0069\n",
      "Epoch 10/10 | Batch 450/1545 | train loss: 2.0283\n",
      "Epoch 10/10 | Batch 500/1545 | train loss: 1.8428\n",
      "Epoch 10/10 | Batch 550/1545 | train loss: 2.0446\n",
      "Epoch 10/10 | Batch 600/1545 | train loss: 1.8837\n",
      "Epoch 10/10 | Batch 650/1545 | train loss: 2.0890\n",
      "Epoch 10/10 | Batch 700/1545 | train loss: 2.0582\n",
      "Epoch 10/10 | Batch 750/1545 | train loss: 1.9004\n",
      "Epoch 10/10 | Batch 800/1545 | train loss: 1.9898\n",
      "Epoch 10/10 | Batch 850/1545 | train loss: 1.8021\n",
      "Epoch 10/10 | Batch 900/1545 | train loss: 1.8266\n",
      "Epoch 10/10 | Batch 950/1545 | train loss: 2.4496\n",
      "Epoch 10/10 | Batch 1000/1545 | train loss: 1.9047\n",
      "Nearest to [six]: industrialized, formed, norway, merit, schedule,\n",
      "Nearest to [gold]: ounce, bullion, platinum, ounces, settled,\n",
      "Nearest to [japan]: eliminating, exchanges, wealth, threaten, halt,\n",
      "Nearest to [college]: basketball, child, sports, baseball, football,\n",
      "Epoch 10/10 | Batch 1050/1545 | train loss: 1.6082\n",
      "Epoch 10/10 | Batch 1100/1545 | train loss: 1.8051\n",
      "Epoch 10/10 | Batch 1150/1545 | train loss: 1.8313\n",
      "Epoch 10/10 | Batch 1200/1545 | train loss: 1.8780\n",
      "Epoch 10/10 | Batch 1250/1545 | train loss: 2.4734\n",
      "Epoch 10/10 | Batch 1300/1545 | train loss: 1.8069\n",
      "Epoch 10/10 | Batch 1350/1545 | train loss: 1.8525\n",
      "Epoch 10/10 | Batch 1400/1545 | train loss: 1.8618\n",
      "Epoch 10/10 | Batch 1450/1545 | train loss: 2.0316\n",
      "Epoch 10/10 | Batch 1500/1545 | train loss: 1.7581\n"
     ]
    }
   ],
   "source": [
    "import string\n",
    "from word2vec_skipgram import SkipGram\n",
    "\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    with open('temp/ptb_train.txt') as f:\n",
    "        text = f.read()\n",
    "    sample_words = ['six', 'gold', 'japan', 'college']\n",
    "\n",
    "    model = SkipGram(text, sample_words, useless_words=string.punctuation)\n",
    "    model.fit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
